
cc.Class({
    extends: require('Bullet'),

    properties: {

    },

    onLoad() {
        this._super();
    },

    onDestroy() {
    },


    getAngle() {
        if (global.GameLoop.GameMgr.getPlayer()) {
            var p1 = this.node.getPosition();
            var p2 = global.GameLoop.GameMgr.getPlayer().node.getPosition();
            var differX = p2.x - p1.x;
            var differY = p2.y - p1.y;
            var differXabx = Math.abs(p2.x - p1.x);
            var differYabs = Math.abs(p2.y - p1.y);
            var angle = (Math.atan(differXabx / differYabs) / Math.PI) * 180;
            var currentAngle = differX >= 0 ? (differY >= 0 ? angle : 180 - angle) : (differY >= 0 ? -angle : angle - 180);
           return currentAngle;
        }
    },

});
